﻿function CompanyProfile(data) {
    this.Id = ko.observable(data.Id ? data.Id : 0);
    this.Created = ko.observable(data.Created ? data.Created : "");
    this.Updated = ko.observable(data.Updated ? data.Updated : "");
    this.Title = ko.observable(data.Title ? data.Title : "").extend({
        required: true,
        maxLength: 30
    });
    this.TagLine = ko.observable(data.TagLine ? data.TagLine : "").extend({
        required: true,
        maxLength: 50
    });
    this.Description = ko.observable(data.Description ? data.Description : "").extend({
        required: true,
        maxLength: 1024
    });
    this.DescriptionShort = ko.observable($("#tinymceCompanyDescription").text());
    this.Website = ko.observable(data.Website ? data.Website : "http://").extend({
        required: true,
        maxLength: 50
    });
    this.Location = ko.observable(data.Location ? data.Location : "").extend({
        required: true,
        maxLength: 50
    });
    this.Website = ko.observable(data.Website ? data.Website : "http://").extend({
        maxLength: 50
    });
    this.IsDefault = ko.observable(data.IsDefault ? data.IsDefault : false);
    this.Photo = ko.observable(data.Photo ? data.Photo : "../../Content/img/250X250_company_icon.png").extend({
        maxLength: 250
    });
    this.Photo150X150 = ko.observable(data.Photo150X150 ? data.Photo150X150 : "../../Content/img/150X150_company_icon.png").extend({
        maxLength: 250
    });
    this.Photo80X80 = ko.observable(data.Photo80X80 ? data.Photo80X80 : "../../Content/img/80X80_company_icon.png").extend({
        maxLength: 250
    });
    this.Photo50X50 = ko.observable(data.Photo50X50 ? data.Photo50X50 : "../../Content/img/50X50_company_icon.png").extend({
        maxLength: 250
    });
    this.CountryFlag = ko.observable(data.CountryFlag ? data.CountryFlag : "");
    this.Email = ko.observable(data.Email ? data.Email : "").extend({
        required: true,
        maxLength: 50,
        email: true
    });
    this.PhoneNumber = ko.observable(data.PhoneNumber ? data.PhoneNumber : "").extend({
        required: true,
        maxLength: 50,
        number: true
    });
    this.Categories = ko.observableArray(data.Categories ? data.Categories : []);
    this.Technologies = ko.observableArray(data.Technologies ? data.Technologies : []);
    this.Positions = ko.observableArray(data.Positions ? data.Positions : []);
    this.UserId = ko.observable(data.UserId ? data.UserId : 0);
    this.Country = ko.observable(data.Country ? data.Country : null).extend({
        required: true
    });
    this.CountryId = ko.observable(data.CountryId ? data.CountryId : 0);
    this.Industry = ko.observable(data.Industry ? data.Industry : null).extend({
        required: true
    });
    this.IndustryId = ko.observable(data.IndustryId ? data.IndustryId : 0);
    this.errors = ko.validation.group(this);
    return;
    
    
}